package uutalk.netcloud.talk.app.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import butterknife.OnClick;
import uutalk.netcloud.talk.R;
import uutalk.netcloud.talk.app.Constants;
import uutalk.netcloud.talk.app.ui.ContentActivity;
import uutalk.netcloud.talk.base.android.BaseFragment;

/**
 * 类描述：
 * 作者：Pengmutian
 * 时间：2018/4/18
 */
public class FirstFragment extends BaseFragment {


    public static FirstFragment newInstance() {
        Bundle args = new Bundle();
        FirstFragment fragment = new FirstFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected int setLayoutResId() {
        return R.layout.layout_first_fragment;
    }

    @Override
    protected void loadData() {

    }

    @Override
    protected void init() {

    }

    @OnClick({R.id.llMsg, R.id.llContacts, R.id.llSingleTalk, R.id.llGroupTalk})
    public void onViewClick(View view){
        switch (view.getId()){
            case R.id.llMsg:{
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.addCategory(Intent.CATEGORY_DEFAULT);
                intent.setType("vnd.android-dir/mms-sms");
                startActivity(intent);
            }break;
            case R.id.llContacts:{
                //定位界面
                Intent intent001 = new Intent();
                intent001.setClassName("com.android.contacts","com.android.contacts.activities.PeopleActivity");
                startActivity(intent001);
            }break;
            case R.id.llSingleTalk:{
                //单聊界面
                Intent intent = new Intent(mActivity, ContentActivity.class);
                intent.putExtra(Constants.KEY_FRAGMENT, Constants.SIGLE_FRAGMENT);
                startActivity(intent);
            }break;
            case R.id.llGroupTalk:{
                //群聊界面
                Intent intent = new Intent(mActivity, ContentActivity.class);
                intent.putExtra(Constants.KEY_FRAGMENT, Constants.GROUP_FRAGMENT);
                startActivity(intent);
            }break;
        }
    }
}
